<template>
	<view class="newcontents">
		<rich-text :nodes="contents"></rich-text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				//新闻列表
				contents:'',
				newId:0
			}
		},
		onLoad(){
			let news = wx.getStorageSync('news');
			console.log(news)
			let txt = news.contents;
			 //富文本内容
			this.contents =  txt.replace(/<img/gi,'<img style="max-width:100%;height:auto;margin:0 auto;display:block"')
			this.newId = news.newId
		},
		methods: {
		}
	}
</script>

<style>
	.newcontents{
		margin: 5rpx 10rpx;
	}
</style>